ImagXpress 13 for .NET - User Guide > How To > Save an Image > Save Image to Stream |
Prior to saving an image, set the SaveOptions to provide specific instructions for saving the image. If no save options are specified, ImagXpress® uses default values when saving the image.
To save an image to a memory or file stream, call ImageX.SaveStream. The ImageStatusEvent and ProgressEvent events are raised to provide feedback on the status of the saving process.
To save to a BLOB (Binary Large Object), use the ImageX.SaveStream method. |
To save a file to an Internet stream, use the ImageX.Save method, specifying the full Internet path and file name, NOT the SaveStream method. |
To save an ImageX image to stream:
C# Example |
Copy Code
|
---|---|
// This code demonstrates saving an image to a stream using System.IO; using Accusoft.ImagXpressSdk; using (MemoryStream stream = new MemoryStream()) { // Initialize the ImagXpress workspace component using (ImagXpress imagXpress1 = new ImagXpress()) { using (ImageX image = ImageX.FromFile(imagXpress1, "C:\\images\\somefile.tif")) { //Set up the SaveOptions SaveOptions saveOptions = new SaveOptions(); saveOptions.Format = ImageXFormat.Tiff; saveOptions.Tiff.Compression = Compression.Group4; image.SaveStream(stream, saveOptions); } } |